package org.mathig.poker;

public class PlayerWrapper {

	private static int idFactory = 0;

	private Integer id;

	private Player player;

	public PlayerWrapper(Player player) {
		this.player = player;
		this.id = new Integer(idFactory++);
	}

	@Override
	public boolean equals(Object obj) {
		if (obj instanceof PlayerWrapper) {
			return id.equals(((PlayerWrapper) obj).id);
		}
		return false;
	}

	@Override
	public int hashCode() {
		return id.hashCode();
	}

	@Override
	public String toString() {
		return player.getName();
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Player getPlayer() {
		return player;
	}

	public void setPlayer(Player player) {
		this.player = player;
	}

}
